home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / Pascal / Skel 3.0i / Skel globals.p < prev    next >
Text File  |  1994-04-18  |  1KB  |  57 lines

  1. unit Globals;
  2.  
  3. interface
  4.  
  5. {Defines}
  6.  
  7. {    The following constant is not defined in any .h file.  It}
  8. {    is described in "Inside Macintosh" - Event Manager, pp. 14-15.}
  9.  
  10.     const
  11.         charcodemask = 255;
  12.  
  13.         lastmenu = 2;        (* number of menus *)
  14.         applemenu = 1;    (* menu ID for desk accessory menu *)
  15.         filemenu = 2;        (* menu ID for File menu *)
  16.         lastmenuPlus1 = lastmenu + 1;
  17.  
  18.         irattle = 1;        (* items in the File menu *)
  19.         ifrighten = 2;
  20.  (*-------*)
  21.         iquit = 4;
  22.  
  23.         aboutskelid = 1;    (* Resource ID of the string *)
  24.         rattleid = 2;
  25.         frightenid = 5;
  26.  
  27.         windowid = 260;    (* Resource ID for my window *)
  28.  
  29.         patID = 128; {Resource id for ppat}
  30.  
  31.  
  32. (* Globals *)
  33. {Note: some variables, like whichwindow and windowcode, should really not}
  34. {be globals, IMHO! /LIR}
  35.  
  36.     var
  37.         screenport: GrafPtr;            (* a port for the whole screen *)
  38.         mywindow: WindowPtr;            (* our one window *)
  39.         wrecord: WindowRecord;        (* storage for window record *)
  40.         dragrect: Rect;                (* Rect to drag within *)
  41.         growrect: Rect;                (* bounds for the growth of the windows *)
  42.  
  43.         mymenus: array[1..lastmenu] of MenuHandle;(* our menus *)
  44.  
  45.         myevent: EventRecord;
  46.         whichwindow: WindowPtr;        (* points to window of mouseDown *)
  47.         windowcode: Integer;            (* what mouse was in when event posted *)
  48.         userdone: Boolean;            (* true when user wants to exit program *)
  49.  
  50. {New globals:}
  51.         gWNEImplemented: Boolean;
  52.         gSleep: integer;
  53.         gColorQDFlag: Boolean;
  54.         gAppleEventsInitialized: Boolean;
  55.  
  56. implementation
  57. end.